home *** CD-ROM | disk | FTP | other *** search
/ MacWorld Secrets (4th Edition) / Mac Secrets CD 4th Ed.toast / Apple Advanced Technologies / Apple Speech Technologies 1.5 / PlainTalk Developer Info / Speech Synthesis Manager SDK / Interfaces / Speech.r < prev   
Text File  |  1994-05-05  |  3KB  |  87 lines

  1. /*
  2.     File:        Speech.r
  3.  
  4.     Contains:    Rez definitions for App-defined Pronunciation Dictionaries
  5.  
  6.     Copyright:    © 1992-1994 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #include "SysTypes.r"
  11.  
  12.  
  13. // 'dict' - User dictionary resource
  14.  
  15. type 'dict' {
  16.     longint = DictEnd >> 3;    // total byte length
  17.     longint = 'dict';        // Dictionary atom
  18.     longint = 1;            // format version
  19.     integer Script;            // script system (e.g. smRoman)
  20.     integer Language;        // language code (e.g. langEnglish)
  21.     integer Region;            // region code      (e.g. verUS)
  22.     unsigned longint;        // date last modified (seconds since Jan 1, 1904)
  23.     longint = 0;            // reserved 1
  24.     longint = 0;            // reserved 2
  25.     longint = 0;            // reserved 3
  26.     longint = 0;            // reserved 4
  27.     longint = $$CountOf(EntryArray);    // entry count
  28.     array EntryArray {
  29. EntryBegin:
  30.         integer = (EntryEnd[$$ArrayIndex(EntryArray)] -
  31.                    EntryBegin[$$ArrayIndex(EntryArray)])
  32.                   >> 3;                                // entry byte length
  33.         integer null,pron=0x21,abbr=0x22;            // entry type 
  34.         integer = $$CountOf(FieldList);                // field count
  35.         wide array FieldList {
  36. FieldBegin:
  37.             integer = (FieldEnd[$$ArrayIndex(EntryArray),$$ArrayIndex(FieldList)] -
  38.                        FieldBegin[$$ArrayIndex(EntryArray),$$ArrayIndex(FieldList)])
  39.                       >> 3;                            // field byte length (excluding padding)
  40.             integer null,tx=0x21,ph=0x22,pos=0x23;    // field type
  41.             string;                                    // field data
  42. FieldEnd:
  43.             align word;
  44.         };
  45. EntryEnd:
  46.     };
  47.     
  48. DictEnd:                    // end of dictionary resource
  49. };
  50.  
  51. // Note, the ThisSecond value in the following resource can be 
  52. // easily defined when Rez is invoked.  For example:
  53. //        rez -o Sample.rsrc -d "ThisSecond=`date -n`" DictSample.r
  54.  
  55. #ifndef ThisSecond
  56. #define    ThisSecond    0
  57. #endif
  58.  
  59. /* Here's a sample dictionary to demonstrate the proper format:
  60.  
  61. resource 'dict' (1, "TestDict") {
  62.     smRoman, langEnglish, verUS, ThisSecond,
  63.     {
  64.         pron, {tx, "SARAH",         ph, "_m2AY_s1IHst2AXr"},
  65.         pron, {tx, "ROOSEVELT",     ph, "_1EHf_d1IY_1AAr"},
  66.         pron, {tx, "SAMUEL",         ph, "_s1AEm_AY_2AEm"},
  67.         pron, {tx, "SHAKESPEARE",     ph, "_D2UX_b1AArd_2UXv_1AEv2AAn"},
  68.         pron, {tx, "OHIO",             ph, "_1OW%%h1AY%%1OW"},
  69.         pron, {tx, "ALEXANDER",     ph, "_1AEl_D2UX_p2AEl"},
  70.         pron, {tx, "CHICAGO",         ph, "_st1IHNk2IHN_1UXhny2IHn"},
  71.         pron, {tx, "BEARD",         ph, "_mUXstAES"},
  72.         pron, {tx, "DAVID",         ph, "_gAAl1AYAETs_f1OW"},
  73.         pron, {tx, "DEMOCRATS",     ph, "_r2IHp1UXblIHk2IHn"},
  74.         pron, {tx, "YANKEES",         ph, "_r1EHd_s1AAks"},
  75.         pron, {tx, "RACHEL",         ph, "_m2AY_n1IYs"},
  76.         pron, {tx, "NAKED",         ph, "_ny1UWd"},
  77.         pron, {tx, "OCTOBER",         ph, "_h1AAl2OW_w1IYn"},
  78.         pron, {tx, "MASSACHUSETTS", ph, "_t1AEks_2UX_C1UWsEHts"},
  79.         pron, {tx, "MISSISSIPPI",     ph, "_fl1UXd_k1UXnCr2IY"},
  80.         pron, {tx, "HANOVER",         ph, "_d1AArtmUXT_t1AWn"},
  81.         pron, {tx, "GREENWICH",     ph, "_h1OWm_2UXv_D2UX_r1IHC"},
  82.         pron, {tx, "FELIX",         ph, "_f1IYl2IHks_D2UX_k1AEt"},
  83.         pron, {tx, "WEDNESDAY",     ph, "_m1IHd_w1IYk"},
  84.     },
  85. };
  86.  
  87. */